﻿using System;
using nRoute.Components.Routing;
using nRoute.Navigation.Mapping;
using nRoute.Utilities;

namespace nRoute.Navigation.Mapping
{
	public class DefaultNavigationFileLocator
		 : DefaultNavigationLocatorBase
	{
		private readonly NavigationFileMeta _meta;

		public DefaultNavigationFileLocator(NavigationFileMeta meta)
			: base(meta)
		{
			Guard.ArgumentNotNull(meta, "meta");
			_meta = meta;
		}

#region Overrides

		protected override IRouteHandler CreateRouteHandler()
		{
            // note this is always relative - as WP7 can't use a absolute path for navigation
			return new NavigationFileHandler(new Uri(_meta.FilePath, UriKind.Relative));
		}
		
#endregion

	}
}